package com.lock.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lock.entiy.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {
    // 自定义悲观锁查询方法
    @Select("SELECT * FROM product WHERE id = #{id} FOR UPDATE")
    Product selectByIdForUpdate(Long id);
}
